

<script setup lang="ts">
import {defineComponent} from "vue";
import {getIsComponent} from "@/components/formDesigner/utils.ts";
import {useVModel} from "@vueuse/core";

const emit = defineEmits(['update:activeItem'])
const  props = defineProps({
  model: {
    type: Object,
    default: {}
  },
  // 当前选中的元素
  activeItem: {
    type: Object,
    default: {}
  },
  element: {
    type: Object,
    default: {}
  }
})
defineComponent({
  name: "DesignItem",
})

const activeItemVModel = useVModel(props, 'activeItem', emit)



</script>


<template>
  <component :is="getIsComponent(model.ele)" :field="model" v-model:activeItem="activeItemVModel"></component>
</template>

<style scoped>

</style>
